# zope imports
from zope.component import adapts
from zope.interface import implements

# ATContentType imports
from Products.ATContentTypes.interface.document import IATDocument

# easyarcticle imports
from easyarticle.core.adapters.data import GenericData
from easyarticle.core.interfaces import IData

class DocumentData(GenericData):
    """An generic adapter for to provide some data for sub objects of an 
    EasyArticle components. Developers can provide more specific ones for their 
    own content objects.
    """
    implements(IData)
    adapts(IATDocument)

    def __init__(self, context):
        """        
        """
        self.context = context
        
    def getContent(self):
        """
        """
        content = super(DocumentData, self).getContent()
        content["text"] = self.context.getText()
        
        return content
